Skip to content

Tags: enetx/g

Tags

v1.0.223

Toggle v1.0.223's commit message
feat(iter): add Flatten/FlattenResult, fix Float.String to use decima…

…l format

v1.0.222

Toggle v1.0.222's commit message
ErrSeq, OkSeq

v1.0.221

Toggle v1.0.221's commit message
refactor(print): replace .type/.debug/.wrap modifiers with format spe…

…c verbs

- Add print_fmt.go with Rust-style format mini-language ({:x}, {:>10.2}, {:+05}, etc.)
- Replace .type with {:T}, .debug with {:?}, .wrap with {:w} verb
- Support alignment (<, >, ^), fill, sign (+, -, space), zero-pad, width, precision
- Support verbs: x/X (hex), o (octal), b (binary), e/E (exponential), ? (#? pretty), T, p, w

v1.0.220

Toggle v1.0.220's commit message
feat(option): add Filter, Or, OrElse, IsSomeAnd and mutating methods

- Add Filter for conditional value filtering
- Add Or/OrElse for providing fallback Options
- Add IsSomeAnd to check value against predicate
- Add Insert, GetOrInsert(+With) for mutable value management
- Add Take and Replace for value extraction/swap
- Add OkOr/OkOrElse to convert Option to Result
- Add FromPtr and Ptr for pointer conversions

v1.0.219

Toggle v1.0.219's commit message
refactor(encoding): introduce Encode/Decode wrappers and simplify Res…

…ult mapping

- Move encoding functions (Hex, Base64*, XOR, Binary) to dedicated bytes_encdec.go
- Simplify TransformResult to accept fn(T) U instead of fn(T) Result[U]

v1.0.218

Toggle v1.0.218's commit message
feat(hash,bytes,string): add HMAC, raw digests, Hex, and Base64 variants

- Add Bytes.Hex() for hex encoding raw bytes
- Refactor bytesHasher → rawHasher to separate digest from hex encoding
- Add *Raw() variants for MD5/SHA1/SHA256/SHA512 returning raw digests
- Add HMACSHA256/HMACSHA512 (hex) and HMACSHA256Raw/HMACSHA512Raw for Bytes and String
- Add Base64Raw, Base64URL, Base64RawURL encode/decode variants to String

v1.0.217

Toggle v1.0.217's commit message
feat(pool): preserve submission order in Wait results

Wait now iterates results by task index (0..totalTasks-1) instead of
unordered MapSafe iteration, guaranteeing results match submission order.

v1.0.216

Toggle v1.0.216's commit message
feat(print): add {wrap} modifier to Errorf for error chain support

Errorf now supports a {wrap} modifier that simultaneously formats an
error value into the message and wraps it in the returned error,
enabling errors.Is / errors.As to traverse the chain.

Supported forms:
  {.wrap}       — auto-index
  {1.wrap}      — positional
  {name.wrap}   — named
  multiple {wrap} references wrap multiple errors

Add wrappedError type (Unwrap() []error) to errors.go.
Add TestErrorf covering all forms and edge cases.
Add examples/print/ with basic, format, and errorf examples.

v1.0.215

Toggle v1.0.215's commit message
perf: optimize deque, heap, map, slice, and string internals

- Deque: extract copyToContiguous helper using copy/clear builtins,
  replace per-element realIndex loops with direct range slices in
  Iter, Contains, and String; bulk-copy in DequeOf, Clone, Reserve,
  ShrinkToFit, MakeContiguous, Slice
- Heap: switch to heapify for bulk Push (O(n) vs O(n log n))
- Map: build MapOrd via direct append instead of Insert in Ordered()
- MapOrd: replace iterator chains with direct loops and pre-allocated
  slices in Map, Safe, Keys, Values
- Slice: remove closure in SubSlice loop condition; two explicit loops
- Slice.Iter: use copy instead of SeqSlice.Collect in SeqSlices.Collect
- String: cache .Std() conversions outside hot loops in Chunks,
  Truncate, writePadding; use rand.N + []byte for default Random
  charset; inline f.Contains/StartsWith/EndsWith as strings.*
- f: cache type conversions outside closures in Contains,
  ContainsAnyChars, StartsWith, EndsWith
- Tests: add TestMapOrdKeys, TestMapOrdToMap, TestMapOrdToSafe

v1.0.214

Toggle v1.0.214's commit message
perf: reduce allocations across string, collection, and encoding types

string:
- Lower/Upper/IsLower/IsUpper/IsTitle: Bytes() → BytesUnsafe()/StringUnsafe()
- Random: ASCII fast-path with WriteByte, avoid global charset Runes() alloc
- ReplaceNth: Builder instead of triple string concatenation
- Chunks: ASCII fast-path (zero-copy slicing); Unicode path via
  utf8.DecodeRuneInString, eliminating []rune alloc and per-chunk String([]rune) alloc
- Truncate: ASCII fast-path + single-pass Unicode walk; drop LenRunes()+Runes() double scan
- Center: cache s.LenRunes() and pad.LenRunes() (4 scans → 2)
- writePadding: ASCII fast-path with WriteByte; non-ASCII via utf8.DecodeRuneInString,
  eliminating pad.Runes() alloc on every call
- Reverse: BytesUnsafe()/StringUnsafe()
- Similarity: plain []int for DP table, min() builtins

string/hash: BytesUnsafe()/StringUnsafe() for MD5/SHA1/SHA256/SHA512

string/encode:
- Base64/JSON: BytesUnsafe() to avoid copy
- URL: Grow() pre-allocation
- Hex: inline lookup table — zero per-byte allocs (was: strconv.FormatInt per byte)
- Binary: inline bit shift — zero per-byte allocs (was: fmt.Sprintf per byte)
- Octal: strconv.AppendInt into stack buffer — zero per-rune allocs

string/compress: all five writers use BytesUnsafe() instead of io.WriteString
  (io.WriteString on non-StringWriter falls back to []byte(s) copy)

int: Hex/Octal use strconv.FormatInt instead of fmt.Sprintf

set/map/map_ordered: simplify NewX size param (drop Slice[Int] unwrap indirection)

String() methods: add Grow() pre-allocation to Slice, Set, Map, MapOrd,
  MapSafe, Heap, Deque (n*8 or n*16 estimate reduces realloc churn)

slice: Join pre-computes exact size and uses a single strings.Builder,
  eliminating intermediate []string allocation