15 Commits
Author SHA1 Message Date
z 9d1d622d50 docs(brand): add hero banner 2026-06-28 20:55:57 -07:00
z bc592a2b7a chore(brand): dynamic hero banner 2026-06-28 20:55:56 -07:00
Zach Kelling a2c22dbba7 chore: remove local replace directives 2026-01-08 23:44:14 -08:00
Zach Kelling 21b7243e9f refactor: remove local replace, use published big v0.1.0 2026-01-05 01:38:02 -08:00
Zach Kelling 356605c2c1 chore: update go.mod/sum 2026-01-04 19:29:50 -08:00
Zach Kelling 8edeed68cd safe: add DEX math functions for DRY consolidation
Added functions from node/vms/dexvm/math:
- Div64: safe division with error on zero
- MulBig: multiply uint64s returning big.Int
- MulDiv64: (a * b) / c without overflow
- MulDivRoundUp64: ceiling division variant
- BigMulDiv: big.Int multiplication+division
- BigMulDivRoundUp: big.Int ceiling variant
- Clamp: generic ordered type clamping

Also added common big.Int values (bigZero, bigOne, maxUint64Big)
for performance in division operations.
2026-01-03 18:53:26 -08:00
Zach Kelling fd27f2ecb0 Reorganize math package into subpackages
- Create math/big for big.Int utilities (HexOrDecimal256, U256, parsing)
- Create math/safe for overflow-safe arithmetic (SafeAdd, SafeMul, etc.)
- Move averager files to root package level
- Add re-exports in root package for backwards compatibility
- Update README with new package structure documentation
- Remove old math/meter directory (consolidated elsewhere)
- Remove redundant math/ subdirectory structure
2026-01-03 18:22:33 -08:00
Zach Kelling 7870d52f6f Remove units/ - use luxfi/const for denominations 2026-01-03 17:39:26 -08:00
Zach Kelling 45e2df82ae Add big.Int and integer utilities from geth/common/math
- big.go: BigPow, ParseBig256, U256, U256Bytes, PaddedBigBytes, etc.
- integer.go: HexOrDecimal64, ParseUint64, SafeAdd/Sub/Mul

Consolidating math utilities into luxfi/math to eliminate
geth/common/math dependency.
2026-01-03 17:36:34 -08:00
Zach Kelling 517b493821 Add bit and units subpackages, remove safemath wrapper
- Add math/bit: XOR, AND, compress operations (from bitutil)
- Add math/units: Lux denomination constants (NanoLux, MicroLux, etc.)
- Remove safemath/: was just re-exporting geth/common/math
- Use github.com/luxfi/geth/common/math directly for safe math ops
2026-01-03 15:52:15 -08:00
Zach Kelling 8e13df0a8b chore: update go.mod 2025-12-31 22:21:37 -08:00
Zach Kelling 107c43637e feat: add heap, linked, sorting, zero - remove utils dependency
- Add Zero[T any]() generic function for zero values
- Add IsSortedBytes for byte slice sorting checks
- Add heap/queue.go with priority Queue[T] implementation
- Add heap/map.go with indexed Map[K,V] for heap operations
- Add linked/list.go with doubly-linked List[T]
- Add linked/hashmap.go with ordered HashMap[K,V]
- Update sampleable_set.go to use local luxmath.Zero[T]()
- Update averager_heap.go to use github.com/luxfi/math/heap
- Update safe_math.go to use luxmath.Zero[T]()
- Remove github.com/luxfi/utils dependency entirely
2025-12-24 15:06:41 -08:00
Zach Kelling 086468c3ca refactor: remove node dependency, use extracted packages
- Replace github.com/luxfi/node/utils with github.com/luxfi/utils
- Replace github.com/luxfi/node/utils/sampler with github.com/luxfi/sampler
- Replace github.com/luxfi/node/utils/wrappers with github.com/luxfi/utils/wrappers
- Replace github.com/luxfi/node/utils/json with github.com/luxfi/utils/json
2025-12-24 14:12:00 -08:00
Zach Kelling 5675cd73a6 deps: upgrade crypto to v1.17.25 2025-12-21 11:11:46 -08:00
Zach Kelling 83bf9799d5 Add generic safe math operations
Provides overflow/underflow protected Add, Sub, Mul operations
with generic constraints for all unsigned integer types.
2025-12-19 08:45:58 -08:00