AceLand Unity Packages
  • Home
  • Getting Started
    • Installation
    • Project Settings
    • Architecture Graph
    • Development Level
  • Tutorial
    • Create Your Package
    • Create Project Settings
  • Packages
    • Library
      • Change Log
      • Editor Tools
      • Mono
        • Follow Object
        • Singleton
      • Attributes
        • Conditional Show
        • Inspector Button
        • ReadOnly Field
      • Build Leveling
      • CVS
      • DataTools
      • Disposable Object
      • Extensions
      • Json
      • Kalman Filter
      • Optional
      • Project Setting
      • Serialization Surrogate
      • Utils
    • Event Driven
      • Change Log
      • Event Bus
      • Signal
    • Input
      • Change Log
    • Memento Service
      • Change Log
    • Node Framework
      • Change Log
      • Mono Node
    • Node For Mono (dev)
    • Player Loop Hack
      • Change Log
    • Pool
      • Change Log
    • Security (dev)
    • States
      • Change Log
    • Task Utils
      • Change Log
    • WebRequest
      • Change Log
Powered by GitBook
On this page
  • Bit Generator
  • Data Union 32 / 64
  1. Packages
  2. Library

DataTools

Last updated 6 months ago

Bit Generator

This is a value generator in bit unit. By designed bit shifting method, it can generate over 37m-length non-repeated pattern bit values.

uint startValue = 0b110100101;
int requestLength = 32;

// returning IEnumerable<byte>
BitGenerator.Generate(startValue, requestLength );


Data Union 32 / 64

This is a fastest way to get same memory address as different value type.

DataUnion32 dataUnion = new();
dataUnion.Int = -38546243;
var asFloat = dataUnion.Float;

this is not changing type of value, please read for details.

you may also see related about StructLayout of c#.

Microsoft official document
google results