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.2.1/mod.ts";

Functions

Convert from base64 code to byte array.

Convert from byte array to base64 code.

Decrypt encrypted byte array using AES, read the IV prepended to the byte array.

Encrypt byte array using AES, 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 SHA2 hash algorithm.

Returns random UUID.

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

Returns the system wide application data directory path for each platform.

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.

Returns the system wide user directory path for each platform.

Check if it's running on Windows.

Returns the directory of Deno.mainModule.

Decode byte array in "minipack" format.

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

Convert from backslash to slash.

Returns the system wide temporary directory path for each platform.

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

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.

Convert from UTF-8 byte array to unicode string.

Convert from unicode string to UTF-8 byte array.

Convert from slash to backslash.

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

The file name and byte array pairs that make up the basic file.

Possible types of JSON.

Means the byte array after exporting CryptoKey.

Each is PortableCryptoKey public/private key pair.

ECMAScript primitive types.

Possible input types for URLSearchParams.