GithubHelp home page GithubHelp logo

odin-helpers's Introduction

odin-helpers

This is a small collection of code snippets for the Odin programming language.

This is made by a very inexperience (when it comes to C) programmer, so there will be bugs!

In each of the folders in tests is a folder with the code and resources needed to test each helper. Go there for examples on how to use the procedures.

Following is done:

  • md5.odin - Implementation of the MD5 hashing algorithm in pure Odin.
    • hash([]u8): string Takes a single messages and return it's hash.
  • str.odin - String helper procedures.
    • indexOf(string, string): int Takes a string to search in, and a string to search for. Can also search for runes and u8s.
    • lastIndexOf(string, string): int Takes a string to search in, and a string to search for. Searches from end to beginning of the string. Can also search for runes and u8s.
    • startsWith(string, string): bool Takes a string to search in, and a string to search for. Can also search for runes and u8s.
    • join([]string, string): string Takes a []string to join with the separator. Separator can also be a rune or a u8.
    • split(string, rune): []string Takes a ´string´ and split it into a list of strings using a single separator.
    • trimStart(string): string Takes a string and trim the leading whitespace.
    • trimEnd(string): string Takes a string and trim the trailing whitespace.
    • trim(string): string Takes a string and trim leading and trailing whitespace.
  • file.odin - File helper procedures
    • read_lines(string): []string A procedure that takes a string which is a path to a file. The file will be read in it's full length and returned as a []string where each entry in the list represents a line in the file. The file will be split on \n, \r and \r\n which is Unix, Mac and Windows line endings.

My wishlist

  • Possibly other, newer hashing functions (that are not already in hash.odin).
  • Reading files, line by line - not caring about Unix or Windows line endings.

odin-helpers's People

Watchers

James Cloos avatar Nikolaj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.