Skip to main content
Module

x/simple_utility/mod.ts

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

Functions

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.

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.

Move current directory to Deno.mainModule.

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".

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

Interfaces

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

A map of fetch response types and strings specifying them.

"id" and "password" pair.

Type Aliases

Function returning arbitrary async types.

Possible types of JSON.

Means the byte array after exporting CryptoKey.

Each is PortableCryptoKey public/private key pair.

Possible input types for URLSearchParams.

Function returning arbitrary types.