Code Monkey home page Code Monkey logo

Comments (5)

pimjansen avatar pimjansen commented on August 18, 2024 1

Add your own for now.

from faker.

pimjansen avatar pimjansen commented on August 18, 2024

Well im open for it but adding another lib to implement all this crypto stuff is a bit overkill imo.

For 2.0 we improve the way we use extensions so i guess the best way there would be to create an extension that has a dependency on the ramsey uuid lib. We do not want this from core point of view but duplicating stuff again is also not right.

from faker.

ktom avatar ktom commented on August 18, 2024

Thank you for the feedback
ramsey uuid seems the way to go indeed.

I've also found some quite simple scripts here and there, like in the PHP doc but i don't know how reliable they are and if the mt_rand usage would fit with faker

public static function v4() {
    return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',

      // 32 bits for "time_low"
      mt_rand(0, 0xffff), mt_rand(0, 0xffff),

      // 16 bits for "time_mid"
      mt_rand(0, 0xffff),

      // 16 bits for "time_hi_and_version",
      // four most significant bits holds version number 4
      mt_rand(0, 0x0fff) | 0x4000,

      // 16 bits, 8 bits for "clk_seq_hi_res",
      // 8 bits for "clk_seq_low",
      // two most significant bits holds zero and one for variant DCE1.1
      mt_rand(0, 0x3fff) | 0x8000,

      // 48 bits for "node"
      mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
    );
  }

I can also easily build a small provider for my app for the moment

from faker.

pimjansen avatar pimjansen commented on August 18, 2024

Indeed. Lets stick with this approach since if you look at the total installs and stars and such this is the way to go. Its a simple lib and atleast we know that they are valid at that point (crypto stuff)

I will note it down for a possible extension for v2 though!

from faker.

ktom avatar ktom commented on August 18, 2024

Lets stick with this approach

Sorry i'm not sure i got your point here: did you mean add a simple function in v1 or build my own ?

from faker.

Related Issues (20)

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.