This document provides code for a Caesar cipher encryptor function in Go. The function takes a string and an integer key as inputs, iterates through the runes (characters) of the string, shifts each character by the key, wraps around the alphabet if needed, and returns the encrypted string. It runs in O(n) time and O(n) space.
This document provides code for a Caesar cipher encryptor function in Go. The function takes a string and an integer key as inputs, iterates through the runes (characters) of the string, shifts each character by the key, wraps around the alphabet if needed, and returns the encrypted string. It runs in O(n) time and O(n) space.
This document provides code for a Caesar cipher encryptor function in Go. The function takes a string and an integer key as inputs, iterates through the runes (characters) of the string, shifts each character by the key, wraps around the alphabet if needed, and returns the encrypted string. It runs in O(n) time and O(n) space.