hat

WebJar for hat

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

hat
Последняя версия

Последняя версия

0.0.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

hat
WebJar for hat
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/substack/node-hat

Скачать hat

Имя Файла Размер
hat-0.0.3.pom
hat-0.0.3.jar 5 KB
hat-0.0.3-sources.jar 22 bytes
hat-0.0.3-javadoc.jar 22 bytes
Обзор

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/hat/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>hat</artifactId>
    <version>0.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/hat/
implementation 'org.webjars.npm:hat:0.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/hat/
implementation ("org.webjars.npm:hat:0.0.3")
'org.webjars.npm:hat:jar:0.0.3'
<dependency org="org.webjars.npm" name="hat" rev="0.0.3">
  <artifact name="hat" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='hat', version='0.0.3')
)
libraryDependencies += "org.webjars.npm" % "hat" % "0.0.3"
[org.webjars.npm/hat "0.0.3"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

hat

Generate random IDs and avoid collisions.

hat

examples

hat

var hat = require('hat');

var id = hat();
console.log(id);

output:

0c82a54f22f775a3ed8b97b2dea74036

rack

var hat = require('hat');
var rack = hat.rack();

console.log(rack());
console.log(rack());

output:

1c24171393dc5de04ffcb21f1182ab28
fabe2323acc1b559dee43d4a1e16cbeb

methods

var hat = require('hat');

hat(bits=128, base=16)

Generate a random ID string with bits of data in a base.

Leading zeros are appended such that all outputs for a given number of bits have equal length.

var rack = hat.rack(bits=128, base=16, expandBy)

Make a new hat rack. Call rack() repeatedly to generate new IDs which are checked for collisions.

If expandBy is specified, increment bits by this amount if too many collisions occur. If expandBy isn't specified, rack() will throw if too many collisions occur during generation.

Optionally call var id = rack(data) to store data at the new ID.

You can get the data out again with rack.get(id) and set the data with rack.set(id, value).

how to make a hat

First you will need a large square of cloth or paper. These materials work well:

  • large napkin
  • newspaper

If you find yourself at a fancy restaurant, large napkins are in abundant supply.

Tie a knot in each corner. Place the hat on your head and enjoy!

Версии библиотеки

Версия
0.0.3