cowbell/splittypie

View on GitHub
app/utils/generate-base-58.js

Summary

Maintainability
A
0 mins
Test Coverage
const ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";

export default function generateBase58(length) {
    let result = "";

    for (let i = 0; i < length; i++) {
        result += ALPHABET.charAt(Math.floor(Math.random() * ALPHABET.length));
    }

    return result;
}