Skip to content

Commit

Permalink
fix: optimize JSDoc for Deno
Browse files Browse the repository at this point in the history
  • Loading branch information
frytg committed Dec 16, 2024
1 parent 4487a49 commit da48d91
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
4 changes: 4 additions & 0 deletions crypto/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Crypto Changelog

## 2024-12-16 - 0.0.3

- fix: optimize JSDoc for Deno

## 2024-12-16 - 0.0.2

- fix: optimize key handling for HMAC
Expand Down
2 changes: 1 addition & 1 deletion crypto/deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://jsr.io/schema/config-file.v1.json",
"name": "@frytg/crypto",
"version": "0.0.2",
"version": "0.0.3",
"exports": {
"./hash": "./hash.ts",
"./hmac": "./hmac.ts"
Expand Down
12 changes: 6 additions & 6 deletions crypto/hash.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { createHash } from 'node:crypto'

const HEX_ENCODING = 'hex'

/**
* @module hash
* SHA-256 and SHA-512 hash functions
* @module
* {@linkcode hashSha256 | SHA-256} and {@linkcode hashSha512 | SHA-512} hash functions
*
* @example
* ```ts
Expand All @@ -14,6 +10,10 @@ const HEX_ENCODING = 'hex'
* ```
*/

import { createHash } from 'node:crypto'

const HEX_ENCODING = 'hex'

/**
* Returns a SHA-256 hash of the input string (as hexadecimal string)
* @param str - The string to hash
Expand Down
18 changes: 9 additions & 9 deletions crypto/hmac.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
// load package
import { Buffer } from 'node:buffer'
import { createHmac } from 'node:crypto'

const HEX_ENCODING = 'hex'
const HEX_REGEX = /^[0-9a-fA-F]*$/

/**
* @module hmac
* HMAC SHA-256 and SHA-512 hash functions
* @module
* {@linkcode hmacSha256 | HMAC SHA-256} and {@linkcode hmacSha512 | HMAC SHA-512} hash functions
*
* @example
* ```ts
Expand All @@ -17,6 +10,13 @@ const HEX_REGEX = /^[0-9a-fA-F]*$/
* ```
*/

// load package
import { Buffer } from 'node:buffer'
import { createHmac } from 'node:crypto'

const HEX_ENCODING = 'hex'
const HEX_REGEX = /^[0-9a-fA-F]*$/

/**
* Returns a HMAC SHA-256 hash of the input string (as hexadecimal string)
* @param str - The string to hash
Expand Down

0 comments on commit da48d91

Please sign in to comment.