Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@handy-common-utils/misc-utils
Advanced tools
Miscellaneous utilities
First add it as a dependency:
npm install @handy-common-utils/misc-utils
Then you can use it in the code:
import { shortBase64UrlFromUInt32 } from '@handy-common-utils/misc-utils';
const urlSafeBase64 = shortBase64UrlFromUInt32(12345);
@handy-common-utils/misc-utils
▸ base64FromUInt32<T
>(ui32
): Exclude
<T
, number
> | string
Encode an unsigned 32-bit integer into BASE64 string.
Name | Type |
---|---|
T | extends undefined | null | number |
Name | Type | Description |
---|---|---|
ui32 | T | A number which could also be null or undefined. It must be a valid unsigned 32-bit integer. Behavior is undefined when valueis anything other than an unsigned 32-bit integer. |
Exclude
<T
, number
> | string
BASE64 string representing the integer input, or the original input if it is null or undefined.
▸ base64UrlFromUInt32<T
>(ui32
, replacements?
): Exclude
<T
, number
> | string
Encode an unsigned 32-bit integer into URL/path safe BASE64 string.
Name | Type |
---|---|
T | extends undefined | null | number |
Name | Type | Default value | Description |
---|---|---|---|
ui32 | T | undefined | A number which could also be null or undefined. It must be a valid unsigned 32-bit integer. Behavior is undefined when valueis anything other than an unsigned 32-bit integer. |
replacements | string | '_-=' | A string containing replacement characters for "/", "+", and "=". If omitted, default value of '_-=' would be used. |
Exclude
<T
, number
> | string
URL/path safe BASE64 string representing the integer input, or the original input if it is null or undefined.
▸ shortBase64FromUInt32<T
>(ui32
): Exclude
<T
, number
> | string
Encode an unsigned 32-bit integer into BASE64 string without trailing '='.
Name | Type |
---|---|
T | extends undefined | null | number |
Name | Type | Description |
---|---|---|
ui32 | T | A number which could also be null or undefined. It must be a valid unsigned 32-bit integer. Behavior is undefined when valueis anything other than an unsigned 32-bit integer. |
Exclude
<T
, number
> | string
BASE64 string without trailing '=' representing the integer input, or the original input if it is null or undefined.
▸ shortBase64UrlFromUInt32<T
>(ui32
, replacements?
): Exclude
<T
, number
> | string
Encode an unsigned 32-bit integer into URL/path safe BASE64 string without trailling '='.
Name | Type |
---|---|
T | extends undefined | null | number |
Name | Type | Default value | Description |
---|---|---|---|
ui32 | T | undefined | A number which could also be null or undefined. It must be a valid unsigned 32-bit integer. Behavior is undefined when valueis anything other than an unsigned 32-bit integer. |
replacements | string | '_-' | A string containing replacement characters for "/" and "+". If omitted, default value of '_-' would be used. |
Exclude
<T
, number
> | string
URL/path safe BASE64 string without trailing '=' representing the integer input, or the original input if it is null or undefined.
▸ urlSafe<T
>(base64Input
, replacements?
): T
Make a "normal" (BASE64) string URL/path safe.
Name | Type |
---|---|
T | extends undefined | null | string |
Name | Type | Default value | Description |
---|---|---|---|
base64Input | T | undefined | A (BASE64) string which could be null or undefined. |
replacements | string | '_-=' | A string containing replacement characters for "/", "+", and "=". If omitted, default value of '_-=' would be used. |
T
URL/path safe version of the (BASE64) input string, or the original input if it is null or undefined.
FAQs
Miscellaneous utilities
The npm package @handy-common-utils/misc-utils receives a total of 90 weekly downloads. As such, @handy-common-utils/misc-utils popularity was classified as not popular.
We found that @handy-common-utils/misc-utils demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.