Coder Social home page Coder Social logo

piyush-bhatt / crypto-random-string Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 1.0 22 KB

Deno module to generate a cryptographically strong random string

Home Page: https://deno.land/x/crypto_random_string

License: MIT License

TypeScript 100.00%
crypto deno random random-generator random-string typescript

crypto-random-string's People

Contributors

erfanium avatar piyush-bhatt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

lino-levan

crypto-random-string's Issues

Importing cryptoRandomString from deno.land doesn't work

I'm trying to put together a simple todo app with Deno and am running into an issue where calling crytpoRandomString causes the page to crash without outputting any meaningful error.

The code:

// ..
import { cryptoRandomString } from "https://deno.land/x/[email protected]/mod.ts";

type Props = React.ComponentProps<typeof useDeno>;

type Task = {
  id: string;
  data: string;
};

export default function Home<Props>() {
  const [tasks, setTasks] = useState([] as Task[]);
  const [task, setTask] = useState("");

  const handleAddTask = (e: any) => {
    const newTask: Task = {
      id: cryptoRandomString({
        length: 16,
        type: "abc",
      }),
      data: task,
    };
    setTasks([...tasks, newTask]);
    setTask("");
  };

  // .. 

  return (
   // .. 
   <button onClick={handleAddTask}>Add Task</button>
   // .. 
  );
}

I'm not quite sure why this is happening, but aleph isn't erroring out at the commandline, so this must be some issue with the crypto-random-string lib.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.