Documentation
¶
Overview ¶
Copyright 2023 The acquirecloud Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes2String ¶
Bytes2String transforms bitstream to a string. val contains bytes and only lower bits from any value is used for the calculation. abet - is an alpabet which is used for forming the result string.
func GetRandomString ¶
GetRandomString returns the random generated string with the alphabet abc
func RandomString ¶
RandomString returns a pseudo-random string by length ln.
func RemoveDups ¶
RemoveDups returns a slice where every element from ss meets only once
func SwapEvenOdd ¶
Swaps (in place) odd and even positions of the given string slice, can be useful in reversing 'map' when represented as slice of {k1,v1,k2,v2}
Examples: SwapEvenOdd([]string{1}) returns []string{1} SwapEvenOdd([]string{1,2,3}) returns []string{2,1,3} SwapEvenOdd([]string{1,2,3,4}) returns []string{2,1,4,3}
func TruncateWithEllipses ¶
TruncateWithEllipses truncate string if it doesn't fit into maxLen and add 3 ellipses. Maximum len of resulting string is maxSize
Types ¶
type Hash ¶
Hash type represents a hash value
func CreateHash ¶
CreateHash returns the Hash value by buf
func NewSha256ForData ¶
NewSha256ForData returns the sha256 Hash for the data provided