+/** @brief Convert a string back to a large integer in an arbitrary base
+ * @param v Where to store result as a bigendian bignum
+ * @param nwords Space available in @p v
+ * @param s Input string
+ * @param base Number base (2..62)
+ * @return 0 on success, non-0 on overflow or invalid input
+ *
+ * The inverse of basen(). If the number is much smaller than the buffer then
+ * the first words will be 0.
+ */
+int nesab(uint32_t *v,
+ int nwords,
+ const char *s,
+ unsigned base) {
+ /* Initialize to 0 */
+ memset(v, 0, nwords * sizeof *v);
+ while(*s) {
+ const char *dp = strchr(basen_chars, *s++);
+ if(!dp)
+ return -1;
+ if(mla(v, nwords, base, dp - basen_chars))
+ return -1;
+ }
+ return 0;
+}
+