Code Monkey home page Code Monkey logo

Comments (3)

Fireboltofdeath avatar Fireboltofdeath commented on July 29, 2024

Hash an entire enum

Could you elaborate this? What do you mean by hashing an enum?

from core.

safazi avatar safazi commented on July 29, 2024

A way to hash many strings at once.

@Hash()
enum Keys {
    Test
}

const map = {
    [Keys.Test]: 1
}

could compile to

const map = {
    'asdasdasd-asdasdasdasd-asdasdasd-asdasd': 1
}

or something along those lines

Just any way to hash many things instead of calling hash a lot.

from core.

Fireboltofdeath avatar Fireboltofdeath commented on July 29, 2024

I'm perhaps a bit late on this but I feel like all of the bulletins included in the original post have mostly been solved by Flamework's modding API.

  1. Flamework.hash doesn't directly support this, but the Modding.Obfuscate metadata does if you write your own user macro.
  2. You can write your own user macro instead of Flamework.hash with however short of a name you want (minus the $ prefix)

The third one is a bit more nuanced but I don't think this is necessary with Flamework user macros and would probably be best implemented in a separate transformer like rbxts-transform-guid (although this one doesn't appear to preserve types which could cause issues with incremental compilation and typechecking errors)

With Flamework user macros, I think it'd be more idiomatic to automatically convert names into their hashed versions rather than having the user do so manually (like @flamework/networking does.) Although, it's not currently possible to obfuscate property accesses (without intrinsics) but I intend to support that eventually.

I'm going to close this issue for the above reasons, but feel free to reopen it if you disagree.

from core.

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.