summaryrefslogtreecommitdiff
path: root/src/node_modules/validator/es/lib/isBase32.js
blob: 5150b36176b4eea9c0730f42f0da7e43e223bc19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import assertString from './util/assertString';
var base32 = /^[A-Z2-7]+=*$/;
export default function isBase32(str) {
  assertString(str);
  var len = str.length;

  if (len > 0 && len % 8 === 0 && base32.test(str)) {
    return true;
  }

  return false;
}