Skip to content

Instantly share code, notes, and snippets.

View RobertApikyan's full-sized avatar

Robert Apikyan RobertApikyan

  • V-Mobile
  • Armenia, Yerevan
View GitHub Profile
// A Simple Encryption/Decryption Algorithm
object CCED01_ASCII {
// text to encrypt
// rotationStep is a key for encryption
fun encrypt(text: String, rotationStep:Int): String {
val startIndex = 32 // Start of the printable characters of the ASCII table
val endIndex = 126 // End of the printable characters of the ASCII table
val length = endIndex - startIndex
import com.hfh.wellbe.smartwatch.utils.messagingEncryption.CCED01_v2
import java.lang.IllegalStateException
import kotlin.math.absoluteValue
// A Simple Encryption/Decryption Algorithm
object CCED01_ASCII {
fun encode(text: String): String {
val startIndex = 32
package com.hfh.wellbe.smartwatch.utils.messagingEncryption
import java.lang.IllegalStateException
// A Simple Encryption/Decryption Algorithm for Numbers
object CCED01_v2 {
fun encode(text: String): String {
val rotatingSymbols = mutableListOf<Char>()
import java.lang.IllegalStateException
// A Simple Encryption/Decryption Algorithm
object CCED01_ASCII {
fun encode(text: String,rotationStep:Int): String {
val step = rotationStep%255
// Holds final encoded symbols.
val encoded = StringBuilder()
{
"customer": {
"firstName": "Hans",
"surname": "Tester",
"street": "Hausstr.",
"nameAtBirth": "Tester",
"houseNumber": "32",
"postalCode": "55555",
"placeOfResidence": "Berlin",
"nationality": "D",
import kotlin.math.pow
/**
*
* @param binary can contain only 1 and 0 digits, for example, 1010011, otherwise, it will throw IllegalArgumentException.
* @param groupLength defines each group length that a given binary number would be divided,by default it is 5.
*
* */
object BinaryConverter {
package com.hfh.wellbe.smartwatch.utils.messagingEncryption
import java.lang.IllegalStateException
// A Simple Encryption/Decryption Algorithm for Numbers
object CCED01 {
private val numberToSymbols = mapOf(
0 to '@',
1 to '#',
import java.lang.IllegalStateException
// A Simple Encryption/Decryption Algorithm for Numbers
object CCED01 {
private val numberToSymbols = mapOf(
0 to '@',
1 to '#',
2 to '$',
3 to '%',
{
"customer": {
"firstName": "Hans",
"surname": "Tester",
"street": "Hausstr.",
"nameAtBirth": "Tester",
"houseNumber": "32",
"postalCode": "55555",
"placeOfResidence": "Berlin",
"nationality": "D",
package com.hfh.wellbe.smartwatch.enums
enum class AssistantActionControlType(val value: Int) {
None(0),
AnswerCall(1),
Cancel(2),
DeclineCall(3),
Diagnostic(4),
ErrorOccurred(5),
HangUp(6),