Mini Functions 🦀

Made With Love

Highly performant utility and wrapper functions library for Rust 🚀

Mini Functions

Crates.io Lib.rs Docs.rs License

divider

WebsiteDocumentationReport BugRequest FeatureContributing Guidelines

Welcome to the Mini Functions Library for Rust 👋

Mini Functions is a highly performant utility and wrapper functions library for Rust that has been carefully designed with optimization and efficiency in mind.

By providing convenient wrapper functions, our library aims to provide a high-level interface for common tasks while still leveraging the performance benefits of Rust under the hood.

These utility functions serve as an essential toolkit for any Rust developer, and the library's design abstractions allow for easy integration into a variety of projects and applications.

Key Features 🎯

Requirements 📋

mini-functions requires Rust 1.57.0 or later.

Installation 📦

It takes just a few minutes to get up and running with mini-functions. Check out our documentation for more information.

Add the following to your Cargo.toml file:

toml [dependencies] mini-functions = "0.0.5"

Usage 📖

Add the following to your main.rs file:

rust use mini_functions::*;

then you can use the functions in your application code.

The Functions library 📚

Mini Functions is a library of functions for Rust that provides a collection of tools for working with various aspects of a Rust application.

The functions in Mini Functions are optimized for speed and efficiency, making them useful for a variety of applications, including those that require fast performance or that need to handle large amounts of data.

The mini-functions library consists of the following functions:

The following tables provide a brief description of each function in the mini-functions library.

Date and time functions

| Function | Include File | Function Prototype | Description | | -------- | ------------ | ------------------ | ----------- | | Date::date() | date.rs | fn date() | Returns the current date in UTC format. | | Date::day() | date.rs | fn day() | Returns the current day. | | Date::hour() | date.rs | fn hour() | Returns the current hour. | | Date::iso_8601() | date.rs | fn iso_8601() | Returns the current date and time in ISO 8601 format. | | Date::microsecond() | date.rs | fn microsecond() | Returns the current microsecond. | | Date::millisecond() | date.rs | fn millisecond() | Returns the current millisecond. | | Date::minute() | date.rs | fn minute() | Returns the current minute. | | Date::month() | date.rs | fn month() | Returns the current month. | | Date::nanosecond() | date.rs | fn nanosecond() | Returns the current nanosecond. | | Date::now_utc() | date.rs | fn now_utc() | Returns the current date and time in UTC format. | | Date::second() | date.rs | fn second() | Returns the current second. | | Date::timestamp() | date.rs | fn timestamp() | Returns the current timestamp. | | Date::weekday() | date.rs | fn weekday() | Returns the current weekday. | | Date::year() | date.rs | fn year() | Returns the current year. |

Log functions

| Function | Include File | Function Prototype | Description | | -------- | ------------ | ------------------ | ----------- | | Log::log() | log.rs | fn log() | Logs a message to the console.| | Log::new() | log.rs | fn new() | Creates a new log instance. |

QRCode functions

| Function | Include File | Function Prototype | Description | | -------- | ------------ | ------------------ | ----------- | | QRCode::colorize() | qrcode.rs | fn colorize() | Colorizes the QRCode instance. | | QRCode::from_bytes() | qrcode.rs | fn from_bytes() | Creates a new QRCode instance from a byte array. | | QRCode::from_string() | qrcode.rs | fn from_string() | Creates a new QRCode instance from a string. | | QRCode::new() | qrcode.rs | fn new() | Creates a new QRCode instance. | | QRCode::resize() | qrcode.rs | fn resize() | Resizes the QRCode instance. | | QRCode::to_png() | qrcode.rs | fn to_png() | Converts the QRCode instance to a PNG image. | | QRCode::to_qrcode() | qrcode.rs | fn to_qrcode() | Converts the QRCode instance to a QRCode image. | | QRCode::to_svg() | qrcode.rs | fn to_svg() | Converts the QRCode instance to a SVG image. |

Random number functions

| Function | Include File | Function Prototype | Description | | -------- | ------------ | ------------------ | ----------- | | Random::bytes() | random.rs | fn bytes() | Generates a vector of random bytes of a given length. | | Random::default() | random.rs | fn default() | Creates a new Random struct with a default seed. | | Random::float() | random.rs | fn float() | Generates a random floating point number between 0 and 1. | | Random::int() | random.rs | fn int() | Generates a random integer between a minimum and maximum value. | | Random::new() | random.rs | fn new() | Creates a new Random struct with a seed based on the current system time. | | Random::pseudo() | random.rs | fn pseudo() | Generates a pseudo-random number by XORing the last 31 random numbers together. | | Random::random() | random.rs | fn random() | Generates a random number using the linear congruential generator algorithm. The multiplier for the algorithm is the golden ratio. |

UUID functions

| Function | Include File | Function Prototype | Description | | -------- | ------------ | ------------------ | ----------- | | UUID::new() | uuid.rs | fn new() | Creates a new UUID instance based on the version specified. (v3, v4, v5) | | UUID::uuid_v3() | uuid.rs | fn uuid_v3() | Creates a new UUID v3 instance. | | UUID::uuid_v4() | uuid.rs | fn uuid_v4() | Creates a new UUID v4 instance. | | UUID::uuid_v5() | uuid.rs | fn uuid_v5() | Creates a new UUID v5 instance. |

divider

Semantic Versioning Policy 🚥

For transparency into our release cycle and in striving to maintain backward compatibility, Mini Functions follows semantic versioning.

divider

License 📝

The project is licensed under the terms of both the MIT license and the Apache License (Version 2.0).

divider

Contribution 🤝

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

divider

Acknowledgements 💙

A big thank you to all the awesome contributors of Mini Functions for their help and support.