You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
miguel 9d80904eed implementing the main.go files at the same level as the readme for the exercise 1 year ago
..
README.md docs(checkpoints-exercises): remove piscine imports 1 year ago
main.go implementing the main.go files at the same level as the readme for the exercise 1 year ago

README.md

hashcode

Instructions

Write a function called HashCode() that takes a string as an argument and returns a new hashed string.

  • The hash equation is computed as follows:

(ASCII of current character + size of the string) % 127, ensuring the result falls within the ASCII range of 0 to 127.

  • If the resulting character is unprintable add 33 to it.

Expected function

func HashCode(dec string) string {
}

Usage

Here is a possible program to test your function:

package main

import (
	"fmt"
)

func main() {
	fmt.Println(HashCode("A"))
	fmt.Println(HashCode("AB"))
	fmt.Println(HashCode("BAC"))
	fmt.Println(HashCode("Hello World"))
}

And its output:

$ go run .
B
CD
EDF
Spwwz+bz}wo