# hipstapas.core

> Easy and unobtrusive generation of secure strings, uuids, passphrases (using EFF wordlists) and random numbers.

Latest version **1.2.0** (published 2026-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install hipstapas.core
pnpm add hipstapas.core
yarn add hipstapas.core
bun add hipstapas.core
```

## Health

**Score 45/100 (D)** — status: active.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2026-06-08 |
| First published | 2021-02-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 447.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | keenthinker.com |
| Maintainers | keenthinker |
| Keywords | hipstapas, password, passphrase, secure string, uuid, wordlist, random, npm, eff, dice, hipstapas.dev |

## Links

- npm: https://www.npmjs.com/package/hipstapas.core
- Repository: https://github.com/keenthinker/hipstapas.core
- Homepage: https://github.com/keenthinker/hipstapas.core#readme
- Issues: https://github.com/keenthinker/hipstapas.core/issues
- npm.io page: https://npm.io/package/hipstapas.core

## Dependencies (1)

- [uuid](https://npm.io/package/uuid.md) ^11.1.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.2.0 (latest) — 2026-06-08
- 1.1.2 — 2021-02-01
- 1.1.1 — 2021-02-01
- 1.1.0 — 2021-02-01

## README

# hipstapas.core

![npm](https://img.shields.io/npm/v/hipstapas.core)
![GitHub package.json version](https://img.shields.io/github/package-json/v/keenthinker/hipstapas.core)
![Github License](https://img.shields.io/badge/license-MIT-blue)
![Node.js CI](https://github.com/keenthinker/hipstapas.core/workflows/Node.js%20CI/badge.svg)


Easy and unobtrusive generation of secure strings, uuids, passphrases using EFF wordlists and random numbers.

This package is the core behind [hipstapas.dev](https://hipstapas.dev) - the Hipster Password Helper As A Service, that lets you generate passphrases from anywhere in a second.

# Table of content

- [Installation](#installation)
- [Features](#features)
- [Quick Start](#quick-start)
- [Basic concepts](#basic-concepts)
  - [Input](#input)
  - [Validation](#validation)
  - [Output](#output)
- [Configuration Properties](#configuration-properties)
  - [password](#password)
  - [uuid](#uuid)
  - [wordlist](#wordlist)
  - [random](#random)
- [Examples](#examples)
- [License](#license)

# Installation
This is a Node.js module hosted on npmjs: https://www.npmjs.com/package/hipstapas.core.

Installation is done using the npm install command:

```
npm install hipstapas.core
```

# Features

* Default configurations - generation is as simple as calling a method
* Four different generators
  
  1.Passphrases/Passwords generator
  
  2.UUID v4 generator
  
  3.[EFF dice-generated passhprases](https://www.eff.org/dice)
  
  4.[Cryptographically secure pseudo-random number generator](https://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback)

# Quick Start

Import the module and call the generator (the default configuration values are documented in the [Configuration Properties](#configuration-properties) section):

1. `password`
2. `uuid`
3. `wordlist`
4. `random`

```JavaScript
const hipstapasCore = require('hipstapas.core')

const password = hipstapasCore.password() 
// sample output: C7j|do]t!aj5r]#Od)&R+1UHC

const uuid = hipstapasCore.uuid()
// sample output: 43bf1afd-f9f5-4546-85ea-481b064d6d56

const wordlist =  hipstapasCore.wordlist()
// sample output: companion cope undermine tipoff calamari eternity

const random = hipstapasCore.random()
// sample output: 618554
```

# Basic concepts

## Input

Every method accepts an object as an input parameter, that has different configuration properties described in # Configuration options.

## Validation
Every configuration property is of specific **type** and has a **range** of acceptable values. On each generation call, the passed values are validated regarding type and value range. If either of the two checks fails, the entire validation fails. 

## Output
The generation result is an object, that has three properties:
* `success`: set to `true` if validation and generation were successful; `false` otherwise 
* `result`: an array with generated values when `success = true`
* `error`: validation error description when `success = false`

Example of a *successful* uuid generation:

```JavaScript
{
  success: true,
  result: [ '72e2aecd-3f5b-45c6-abe6-a438428822b3' ],
  error: ''
}
``` 
Examples of a *failed* uuid generation: 

```JavaScript
// wrong parameter type
{
  success: false,
  result: [],
  error: "Only numbers between 1 and 100 are allowed as values for the query parameter 'resultsCount'."
}
// wrong value range
{
  success: false,
  result: [],
  error: "The value of the query parameter 'resultsCount' must be between 1 and 100."
}
```

# Configuration properties

One configuration property is supported by every generator:

|Parameter name|Type|Allowed values|Default value|
|----|----|----|----|
|`resultsCount`|Number|1..100|1|
|Defines how many results should be generated at once|

## `password`

|Parameter name|Type|Allowed values|Default value|
|----|----|----|----|
|`alphabetSmall`|Boolean|true..false|true|
|If set to true the generation alphabet contains small characters: *abcdefghijklmnopqrstuvwxyz*|
|`alphabetCapital`|Boolean|true..false|true|
|If set to true the generation alphabet contains capital characters: *ABCDEFGHIJKLMNOPQRSTUVWXYZ*|
|`alphabetNumber`|Boolean|true..false|true|
|If set to true the generation alphabet contains numbers: *0123456789*|
|`alphabetSpecial`|Boolean|true..false|true|
|If set to true the generation alphabet contains special characters: <em>.,+-*/!?;:{}()[]%$&~#@</em>||
|`lengthMin`|Number|1..2048|16
|Defines the minimal length of the generated phrase|
|`lengthMax`|Number|1..2048|32
|Defines the maximal length of the generated phrase|
|`resultsCount`|Number|1..100|1|
|Defines how many results should be generated at once|

## `uuid`

|Parameter name|Type|Allowed values|Default value|
|----|----|----|----|
|`resultsCount`|Number|1..100|1|
|Defines how many results should be generated at once|

## `wordlist`

|Parameter name|Type|Allowed values|Default value|
|----|----|----|----|
|`words`|Number|1..50|6|
|Defines how many results should be generated at once|
|`resultsCount`|Number|1..100|1|
|Defines how many results should be generated at once|

## `random`

|Parameter name|Type|Allowed values|Default value|
|----|----|----|----|
|`min`|Number|1..1048576|1|
|Defines the lower bound of the number generator|
|`max`|Number|1..1048576|1048576|
|Defines the upper bound of the number generator|
|`sort`|Boolean|true..false|false|
|Sorts the generated number sequence|
|`noDuplicates`|Boolean|true..false|false|
|The generated number sequence should contain only unique numbers|
|`resultsCount`|Number|1..100|1|
|Defines how many results should be generated at once|

# Examples

```JavaScript
const fiftyPasswords = hipstapasCore.password({ resultsCount: 50 })
const fiftyUuids = hipstapasCore.uuid({ resultsCount: 50 })
const fiftyPassphrases = hipstapasCore.wordlist({ resultsCount: 50 })
const fiftyRandomNumbers = hipstapasCore.random({ resultsCount: 50 })

/*
- generate 10 passphrases at once
- where each phrase is exactly 5 characters long
- excluding special and capital characters = using only small characters and numbers
*/
const options = {
  resultsCount: 10,
  lengthMin: 5,
  lengthMax: 5,
  alphabetSpecial: false,
  alphabetCapital: false
}
const passwords = hipstapasCore.password(options)
/* sample output:
{
  success: true,
  result: [
    '1p9d7', 'h88a2',
    'j6yzp', 'fftkg',
    '8d40c', 'uqp3q',
    'yj9wc', 'qjsch',
    'qnlrk', 'men3u'
  ],
  error: ''
}
*/

/*
- generate 5 random numbers at once
- every number should be >= 10 and <= 100
- sort the result sequence
- there should be no duplicates in the result sequence
*/
const optionsRandom = {
  resultsCount: 5,
  min: 10,
  max: 100,
  sort: true,
  noDuplicates: true
}
const randomNumbers = hipstapasCore.random(optionsRandom)
/* sample output: 
{ 
  success: true, 
  result: [ 30, 35, 52, 86, 88 ], 
  error: '' 
}
*/
```

# License

[MIT License](https://github.com/keenthinker/hipstapas.core/blob/main/LICENSE)

---
_Source: https://npm.io/package/hipstapas.core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
