qsu 1.3.0
qsu: ^1.3.0 copied to clipboard
qsu is a utility library that contains useful and frequently used functions. Start with your preferred language and the modern development environment.
Changelog (Dart) #
1.3.0 - 2026-07-28 #
- BREAKING CHANGES:
numberHashnow returns the low 32 bits as a signed value, so it can be negative as documented and matches the JavaScript and Python implementations (numberHash('k10000')is-1184917978, not3110049318) - BREAKING CHANGES: The
base64urlhash encoding is now unpadded, andbinarynow returns the raw digest as latin-1 characters instead of a string of 0s and 1s, both matching the JavaScript and Python implementations - BREAKING CHANGES:
truncateExpectno longer inserts the literal textnullinto the result whenendStringCharis omitted (truncateExpect('Hi. Bye.', 3)returned'Hinull') - BREAKING CHANGES:
numUniquenow returns a millisecond timestamp combined with a per-millisecond sequence (16 digits) instead of a timestamp combined with a random number (18 digits). Repeated calls within a process are now always unique and strictly increasing - BREAKING CHANGES:
isValidDatenow rejects years0100-1599, which the JavaScript and Python implementations also reject. Two-digit years16-99and four-digit years1600-9999remain valid - BREAKING CHANGES:
dayDiffnow returns the absolute difference, so swapping the arguments no longer flips the sign - BREAKING CHANGES:
arrMoveno longer modifies the list it is given; it returns a new one - BREAKING CHANGES:
strRandomreturns an empty string andfuncTimesreturns an empty list for a non-positive count, instead of throwing, matching the JavaScript and Python implementations - BREAKING CHANGES:
objTo1dnow rejects anullseparator, which used to be interpolated into every nested key as the literal textnull - BREAKING CHANGES:
isMatchPathnamenow throws for an empty matcher list instead of quietly returningfalse strUnique: Deduplicate by code point, so characters outside the BMP (emoji) are no longer broken apartcapitalizeFirst,capitalizeEachWords: Return an empty string instead of throwing aRangeErroron empty inputreplaceBetween: Escape the whole delimiter, so multi-character delimiters produce a valid pattern;replaceWithnow defaults to an empty string as documentedremoveSpecialChar,removeLocalePrefix: Escape the caller's characters before building the pattern, so values like']'orzh.CNare matched literally instead of being interpreted as a patternisMatchPathname,removeLocalePrefix: Accept any iterable, not onlyList<String>. AList<dynamic>(what JSON decoding produces) used to be stringified whole and never matchedmd5Hash,sha1Hash,sha256Hash,sha512Hash: Fall back to hex whenencodingis explicitlynullinstead of throwingisBotAgent: Remove 84 of the 172 alternatives that were substrings of another one (botalready matchesnaverbot,bingbot, ...) and could never change the outcome — verified identical on 200,000 inputs. Roughly halves the matching costisBotAgent,isMobile,getSlug,removeSpecialChar,replaceBetween,trim,capitalizeEverySentence,getParsedInfoFromAddress: Compile regular expressions once instead of on every call —getSlugwas building three per characterobjectId,strShuffle,strRandom,numPick: Reuse a singleRandominstance instead of constructing one per draw- BREAKING CHANGES:
getParentFilePathnow handles relative paths (relative/path->/relative), UNC paths, and trailing separators correctly - BREAKING CHANGES:
toValidFilePathnow resolves.and..segments and preserves the UNC\\prefix - BREAKING CHANGES:
getFilePathLevelno longer counts a trailing separator as an extra level (/home/user/now returns the same level as/home/user) - BREAKING CHANGES:
getCopyFileNamenow preserves the original file extension casing (e.g.Report.PDFcopies toReport (1).PDFinstead ofReport (1).pdf) - BREAKING CHANGES:
isValidFileNamenow validates the whole name including its extension (sohello.:txtis invalid) and rejects Windows device names (CON,NUL,COM1-COM9,LPT1-LPT9, etc.) - BREAKING CHANGES:
createFileWithDummynow throws for a negative size instead of returningfalse - BREAKING CHANGES:
createDirectory,moveFile, andcreateFilenow propagate filesystem errors instead of silently ignoring them duration: AdddurationmethodarrPick: AddarrPickmethodgetParsedInfoFromAddress: AddgetParsedInfoFromAddressmethodgetSlug: AddgetSlugmethodhasBadWords: AddhasBadWordsmethod
1.2.1 (2026--) #
capitalizeEachWords: If thenaturaloption is not enabled, characters that are already uppercase will not be converted to lowercase.
1.2.0 - 2026-04-14 #
- BREAKING CHANGES:
strToNumberHashhas renamed tonumberHash md5Hash,sha1Hash,sha256Hash: Add an encoding option for hash functions- Add
sortNumericmethod - Add
sha512Hashmethod
1.1.12 - 2026-03-31 #
- BREAKING CHANGES:
numRandomhas renamed tonumPick getFileName: Fix incorrect directory name with include dot character- Add
getCopyFileNamemethod - Add
divmethod - Add
mulmethod - Add
submethod - Add
summethod - Add
createDateListFromRangemethod - Add
dateToYYYYMMDDmethod - Add
dayDiffmethod - Add
isValidDatemethod - Add
todaymethod
1.1.11 - 2025-12-10 #
- Add
splitmethod - Add
isMobilemethod - Add
objDeleteKeyByValuemethod
1.1.10 - 2025-11-25 #
- Fix package dependencies
1.1.9 - 2025-11-25 #
- Add
getFileSizemethod - Add
normalizeFilemethod - Add
headFilemethod - Add
tailFilemethod - Add
removeLocalePrefixmethod - Add
isMatchPathnamemethod - Add
isBotAgentmethod - Add
ceilargument to thefileSizeFormatmethod
1.1.8 - 2025-11-13 #
- Add
createDirectorymethod - Add
getParentFilePathmethod - Add
deleteFilemethod - Add
createFilemethod - Add
deleteAllFileFromDirectorymethod - Add
moveFilemethod - Add
createFileWithDummymethod - Add
getFileInfomethod - Add
joinFilePathmethod - Add
getFileHashFromPathmethod
1.1.7 - 2025-11-03 #
- BREAKING CHANGES:
getFileSizehas renamed tofileSizeFormat - BREAKING CHANGES:
safeJSONParse: 'fallback' parameters has changed to named parameter - BREAKING CHANGES:
objToArray: 'recursive' parameters has changed to named parameter - Add
getFileNameandgetFileExtensionmethods - Add
isFileExistsmethod - Add
isValidFileNamemethod - Add
toPosixFilePathmethod - Add
getFilePathLevelmethod - Add
toValidFilePathmethod
1.1.6 - 2025-10-15 #
isEmail: addonlyLowerCaseparameter- Add
consolemethod - Add
getStrBytesmethod
1.1.5 - 2025-03-06 #
- Update
README.md
1.1.4 - 2025-02-28 #
- Update documentation
1.1.3 - 2025-02-14 #
- Fix
isUrlparameters
1.1.2 - 2025-02-14 #
- Add
debouncemethod - Add
isUrlmethod - Add
isObjectmethod - Add
isEqualmethod - Add
isEqualStrictmethod - Add
isEmptymethod
1.1.1 - 2024-11-26 #
- Fix
objTo1dparameters
1.1.0 - 2024-11-26 #
- Add
arrCountmethod - Add
betweenmethod - Add
arrGroupByMaxCountmethod - Add
numPickmethod - Add
lenmethod - Add
isTrueMinimumNumberOfTimesmethod - Add
objToQueryStringmethod - Add
objToArraymethod - Add
objTo1dmethod
1.0.0 - 2024-10-19 #
- Add
fileSizemethod - Add
fileExtmethod - Add
safeParseIntmethod - Add
isEmailmethod - Add
fileNamemethod - Add
safeJSONParsemethod - Add
md5Hashmethod - Add
sha1Hashmethod - Add
sha256Hashmethod - Add
encodeBase64method - Add
decodeBase64method - Add
strToNumberHashmethod - Add
objectIdmethod
0.0.4 - 2024-10-02 #
- Add
averagemethod - Add
arrMovemethod - Add
arrTo1dArraymethod - Add
arrRepeatmethod
0.0.3 - 2024-10-02 #
- Add
strShufflemethod - Add
strRandommethod - Add
truncateExpectmethod - Add
strUniquemethod - Add
strToAsciimethod - Add
urlJoinmethod - Add
arrWithDefaultmethod - Add
arrWithNumbermethod - Add
funcTimesmethod - Add
is2dArraymethod - Add
arrUniquemethod
0.0.2 - 2024-09-10 #
- Add
trimmethod - Add
replaceBetweenmethod - Add
removeNewLinemethod - Add
capitalizeEverySentencemethod - Add
containsmethod - Add
capitalizeEachWordsmethod - Add
strCountmethod - Add
sleepmethod - Add
arrShufflemethod - Add
removeSpecialCharmethod
0.0.1 - 2024-09-02 - Not for Production #
- Initial release