VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Verse Language·Up to Community Snippets · Verse Language·79 of 114 in Verse Language

Hexadecimal Encoding

Hexadecimal

Verse from sprintermax/UEFNVerseSnippets (VerseLogic/ExtraModules/Encoding/Hexadecimal.verse), by sprintermax, under the MIT license. Pinned at commit a6b6363bd. Compile-checked and ready to adapt for UEFN.

  • Hexadecimal<public> := module{
        using. BitMath
        using. MathFeatures
        using. StringProcessing
    
        UpperCaseHexAlphabet<public> : string = "0123456789ABCDEF"
        LowerCaseHexAlphabet<public> : string = "0123456789abcdef"
    
        ReverseHexTable<public> : [char]int = map{
            '0' => 0, '1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9,
            'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15,
            'a' => 10, 'b' => 11, 'c' => 12, 'd' => 13, 'e' => 14, 'f' => 15
        }
    
        # Converts a single byte (0-255) to its two-character hexadecimal representation
        # By default uses uppercase letters, but can use lowercase if wanted (for ex in MD5 Hashes)
        # Fails if the input is outside the byte range
        EncodeByteToHex<public>(Byte:int, ?LowerCase:logic=false)<computes><decides>:string = {
            HexAlphabet := LowerCase? and LowerCaseHexAlphabet or UpperCaseHexAlphabet

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Verse Language · 79 of 114
Prev
sprintermax uefnversesnippets constants
Next
sprintermax uefnversesnippets modulesconfig

Source

Epic Games documentation

sprintermax

MIT

View original
VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse