UNPKG

@i-xi-dev/base64

Version:

A JavaScript Base64 encoder and decoder, implements Forgiving base64 defined in WHATWG Infra Standard.

28 lines (27 loc) 784 B
import { inRange } from "./number.js"; export var Uint6; (function (Uint6) { /** * The number of bits used to represent a 6-bit unsigned integer. */ Uint6.SIZE = 6; /** * The minimum value of 6-bit unsigned integer. */ Uint6.MIN_VALUE = 0x0; /** * The maximum value of 6-bit unsigned integer. */ Uint6.MAX_VALUE = 0x3F; /** * Determines whether the passed `test` is a 6-bit unsigned integer. * * @param test - The value to be tested * @returns Whether the passed `test` is a 6-bit unsigned integer. */ function isUint6(test) { return Number.isSafeInteger(test) && inRange(test, [Uint6.MIN_VALUE, Uint6.MAX_VALUE]); } Uint6.isUint6 = isUint6; })(Uint6 || (Uint6 = {}));