ConvertString extension
Extension methods for String to provide various utilities for string manipulation, encoding, decoding, and hashing.
This extension adds methods to the String class for tasks such as hashing the string
using MD5, converting between different encoding formats (Base64, Base32), converting
a string to an ObjectId
, and generating slugs.
- on
Properties
- oID → ObjectId?
-
Available on String, provided by the ConvertString extension
Converts the string to anObjectId
, or returns null if the string is not a valid ObjectId.no setter
Methods
-
fromBase32(
{String def = ''}) → String -
Available on String, provided by the ConvertString extension
Decodes the string from Base32 encoding and returns the resulting string. -
fromBase64(
{String def = ''}) → String -
Available on String, provided by the ConvertString extension
Decodes the string from Base64 encoding and returns the resulting string. -
isSlug(
) → bool -
Available on String, provided by the ConvertString extension
Checks if the string is a valid slug. -
toBase32(
) → String -
Available on String, provided by the ConvertString extension
Encodes the string to Base32 format. -
toBase64(
) → String -
Available on String, provided by the ConvertString extension
Encodes the string to Base64 format. -
toMd5(
) → String -
Available on String, provided by the ConvertString extension
Computes the MD5 hash of the string and returns it as a hexadecimal String. -
toSlug(
) → String -
Available on String, provided by the ConvertString extension
Converts the string to a slug by replacing spaces and non-alphanumeric characters.