arithmetic-operations-for/naturals-big-endian

View on GitHub
src/core/convert/_from_string.js

Summary

Maintainability
A
0 mins
Test Coverage
import _int from './_int.js';

/**
 * Converts a string representation to a limb array representation without
 * radix conversion.
 *
 * @param {string} string input string
 *
 * @return {number[]} output limb array
 */
export default function _from_string(string) {
    const n = string.length;

    const a = [];

    for (let k = 0; k < n; ++k) a.push(_int(string[k]));

    return a;
}