@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
JavaScript
import { inRange } from "./number.js";
export var Uint7;
(function (Uint7) {
/**
* The number of bits used to represent a 7-bit unsigned integer.
*/
Uint7.SIZE = 7;
/**
* The minimum value of 7-bit unsigned integer.
*/
Uint7.MIN_VALUE = 0x0;
/**
* The maximum value of 7-bit unsigned integer.
*/
Uint7.MAX_VALUE = 0x7F;
/**
* Determines whether the passed `test` is a 7-bit unsigned integer.
*
* @param test - The value to be tested
* @returns Whether the passed `test` is a 7-bit unsigned integer.
*/
function isUint7(test) {
return Number.isSafeInteger(test) &&
inRange(test, [Uint7.MIN_VALUE, Uint7.MAX_VALUE]);
}
Uint7.isUint7 = isUint7;
})(Uint7 || (Uint7 = {}));