lib/genid.js
function bignumToString(bignum, base, alphabet) {
        // Prefer native conversion
        if (alphabet === "native" && base != 6) {
            return bignum.toString(base);
        }

        // Old-sk00l conversion
        var result = [];

        while (bignum.gt(0)) {
            var ord = bignum.mod(base);
            result.push(alphabet.charAt(ord));
            bignum = bignum.div(base);
        }

        return result.reverse().join("");
    }
function bignumToString(bignum, base, alphabet) {
        // Prefer native conversion
        if (alphabet === "native" && base != 6) {
            return bignum.toString(base);
        }

        // Old-sk00l conversion
        var result = [];

        while (bignum.gt(0)) {
            var ord = bignum.mod(base);
            result.push(alphabet.charAt(ord));
            bignum = bignum.div(base);
        }

        return result.reverse().join("");
    }
function bignumToString ( bignum , base , alphabet ) { // Prefer native conversion if ( alphabet === "native" && base != 6 ) { return bignum . toString ( base ) ; } // Old-sk00l conversion var result = [ ] ; while ( bignum . gt ( 0 ) ) { var ord = bignum . mod ( base ) ; result . push ( alphabet . charAt ( ord ) ) ; bignum = bignum . div ( base ) ; } return result . reverse ( ) . join ( "" ) ; }
Convert the bignum to a string with the given base
Convert the bignum to a string with the given base