Skip to content

Commit

Permalink
Merge pull request #130 from ndaidong/11.1.1
Browse files Browse the repository at this point in the history
v11.1.1
  • Loading branch information
ndaidong committed Oct 12, 2022
2 parents 60eebba + fbc3717 commit 187f087
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 143 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci-test.yml
Expand Up @@ -8,11 +8,11 @@ on: [push, pull_request]
jobs:
test:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

strategy:
matrix:
node_version: [15.x, 16.x, 17.x, 18.x]
node_version: [14.x, 15.x, 16.x, 17.x, 18.x]

steps:
- uses: actions/checkout@v2
Expand All @@ -29,7 +29,6 @@ jobs:

- name: run npm scripts
run: |
npm i -g standard
npm install
npm run lint
npm run test
Expand Down
25 changes: 0 additions & 25 deletions README.md
Expand Up @@ -21,7 +21,6 @@ You may be interested in [BellaPy](https://github.com/ndaidong/bellapy) too.
* [Array utils](#array-utils): [`pick`](#pickarray-arr--number-count--1), [`sort`](#sortarray-arr--function-compare), [`sortBy`](#sortbyarray-arr-number-order-string-property), [`shuffle`](#shufflearray-arr), [`unique`](#uniquearray-arr)
* [Functional utils](#functional-utils): [`curry`](#curryfn), [`compose`](#composef1-f2-fn), [`pipe`](#pipef1-f2-fn), [`maybe`](#maybeanything-val)
* [Date utils](#date-utils): [`formatDateString`](#formatdatestringdate--timestamp--string-locale--object-options), [`formatTimeAgo`](#formattimeagodate--timestamp--string-locale--string-justnow)
* [Crypto utils](#crypto-utils): [`sha256`](#sha256), [`sha512`](#sha512)
* [Random utils](#random-utils): [`randint`](#randintnumber-min--number-max), [`genid`](#genidnumber-length--string-prefix)

* [Test](#test)
Expand Down Expand Up @@ -489,28 +488,6 @@ Please refer the following resources for more info:
- [Intl.Locale](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale)


### Crypto utils

#### `sha256()`

Generate signature for a text using SHA-256 Cryptographic Hash Algorithm.

```js
import { sha256 } from 'bellajs'

sha256(text) // => hashed string 64 hex characters, 256-bit (16-byte)
```

#### `sha512()`

Generate signature for a text using SHA-512 Cryptographic Hash Algorithm.

```js
import { sha512 } from 'bellajs'

sha512(text) // => hashed string 128 hex characters, 512-bit (32-byte)
```

### Random utils

#### `randint([Number min [, Number max]])`
Expand All @@ -537,8 +514,6 @@ genid(5) // => random 5 chars
genid(5, 'X_') // => X_{random 3 chars}
```

When `length` > 128, only first 99 characters are being generated using `crypto.getRandomValues()`, the rest will be calculated with `Math.random()`.

## Test

```bash
Expand Down
4 changes: 2 additions & 2 deletions dist/bella.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 187f087

Please sign in to comment.