Skip to main content
Module

x/simple_utility/mod.compatible.ts

A handy utility collection.
Go to Latest
import * as simpleUtility from "https://deno.land/x/simple_utility@v0.0.9/mod.compatible.ts";

Functions

Convert from base64 code to byte array.

Convert from byte array to base64 code.

Decrypt encrypted byte array using AES-GCM with 256 bits key 128 bits tag and 96 bits IV. Read the IV prepended to the byte array.

Encrypt byte array using AES-GCM with 256 bits key, 128 bits tag and 96 bits IV. The IV is prepended to the byte array.

Generate and export public/private key pair as a portable byte array.

Derive SHA2 hash value from byte array.

Returns random byte array with the specified number of bytes.

Create byte array signature using the private key and SHA384 hash algorithm.

Verifies the correct signature of a byte array using the public key and SHA384 hash algorithm.

Since the unixtime that can be handled by the Date is in milliseconds, the argument of this method is internally multiplied by x1000.

Since the unixtime that can be handled by the Date is in milliseconds, this method output downscaled to 1/1000.

Convert formatted datetime string such as ISO8601 to unixtime.

Decompress "deflate" format (RFC1951) binary. Binaries containing header information like "gzip" (RFC1952) or "zlib" (RFC1950) cannot be decompressed.

Compress binary in "deflate" format (RFC1951). It does not include header information like "gzip" (RFC1952) or "zlib" (RFC1950) as it does purely "compression only".

Extended fetch function that can directly specify the response type.

Convert from byte array to HEX string.

Decode byte array in "minipack" format.

Encode data into a byte array in "minipack" format.

In addition to leading and trailing spaces, tabs, carriage returns, and two or more consecutive spaces are converted to a single space.

Convert from UTF-8 byte array to unicode string.

Convert from unicode string to UTF-8 byte array.

Interfaces

Option to remove window from RequestInit and add query for query string.

A map of fetch response types and strings specifying them.

Type Aliases

Means the byte array after exporting CryptoKey.

Each is PortableCryptoKey public/private key pair.