Skip to main content
Module

x/dtils/mod.ts

The best unofficial library of utilities for Deno applications
Go to Latest
import * as dtils from "https://deno.land/x/dtils@2.0.0-beta.1/mod.ts";

Functions

Returns true if arrays are found to match in a shallow-equal test

Chooses a random item from the array and returns it

Asymmetrically decrypt encryptedBytes using a base64 encoded privateKey. Function will error if privateKey is not an RSA private key

Asymmetrically decrypt encryptedBytes using privateKeyBytes. Function will error if privateKeyBytes is not an RSA public key

Symmetrically decrypt bytes using key, which must be a base64 encoded AES key and prepended 16 byte counter

Symmetrically decrypt bytes using keyBytes, which must be an AES key, with a 16 byte counter prepended

Asymmetrically encrypt plainBytes using a base64 encoded publicKey. Function will error if publicKey is not an RSA public key

Asymmetrically encrypt plainBytes using publicKeyBytes. Function will error if publicKeyBytes is not an RSA public key

Symmetrically encrypt bytes using key, which must be a base64 encoded AES key and prepended 16 byte counter

Symmetrically encrypt bytes using keyBytes, which must be an AES key, with a 16 byte counter prepended

Sets the amount of zeros before a number. If digits is null, there will be no extra digits in front of the number

Format date using the specified pattern.

Generates a base64 encoded key pair for asymmetric encryptions using the RSA algorithm

Generates a key pair for asymmetric encryptions using the RSA algorithm

Generates a base64 encoded encryption key for symmetric encryptions using the AES algorithm

Generates an encryption key for symmetric encryptions using the AES algorithm

Generates an asymmetric, base64 encoded key pair for signing or encryption purposes

Generates an asymmetric key pair for signing or encryption purposes

Generates a base64 encoded key pair for asymmetric signings using the EC algorithm

Generates a key pair for asymmetric signings using the EC algorithm

Hashes a password into a symmetric encryption key for encryptions using the AES algorithm. Function assumes that password and salt are utf characters, not base64

Hashes a password into a symmetric encryption key for encryptions using the AES algorithm

Parses a string of query string parameters

Prepends new items onto items

Returns a random number between min and max (both included)

Executes shell code. Returns the exit code of the sh runner

Executes shell code and captures the output.

Executes shell code and ignores the output, except when the program is unsuccessful. In that case, the stderr is printed.

Creates a digital signature using a base64 encoded EC private key. Note: function will error if the key passed in is not a private key

Creates a digital signature using an EC private key. Note: function will error if the key passed in is not a private key

Verifies that signature is from the EC private key corresponding to publicKey. Function will error if publicKey is not a base64 encoded EC public key

Verifies that signature is from the EC private key corresponding to publicKey. Function will error if publicKey is not an EC public key