isBase32.js 246 B

123456789101112
  1. import assertString from './util/assertString';
  2. var base32 = /^[A-Z2-7]+=*$/;
  3. export default function isBase32(str) {
  4. assertString(str);
  5. var len = str.length;
  6. if (len % 8 === 0 && base32.test(str)) {
  7. return true;
  8. }
  9. return false;
  10. }