Acak Kalimat

Kadang kala kita memerlukan privasi lebih, dimana orang lain tidak boleh tahu tentang isi data suatu data base / paragraf dari suatu memo, berikut contoh pengacak kata, kalimat, field, atau pun paragrap yang dapat di gunakan pada system pemrograman yang sedang kita buat / kerjakan, fungsi encript dan descript berikut mungkin bisa membantu anda.

 

 

  • FUNCTION encript
  • PARAMETER p_kata
  • IF EMPTY(p_kata)
  • RETURN “”
  • ENDIF
  • LOCAL l_hasil, l_acak, l_index, i
  • l_acak = “MULYONO RAFIANTO”
  • l_hasil = “”
  • l_index = 1
  • FOR i = 1 TO LEN(ALLTRIM(p_kata))
  • l_hasil = l_hasil + CHR(ASC(SUBSTR(p_kata, i, 1)) – ASC(SUBSTR(l_acak, l_index, 1)))
  • l_index = l_index + 1
  • IF l_index > LEN(l_acak)
  • l_index = 1
  • ENDIF
  • ENDFOR
  • RETURN l_hasil
  • ENDFUNC
  • FUNCTION descript
  • PARAMETER p_kata
  • LOCAL l_hasil, l_acak, l_index, i
  • l_acak = “MULYONO RAFIANTO”
  • l_hasil = “”
  • l_index = 1
  • FOR i = 1 TO LEN(ALLTRIM(p_kata))
  • l_hasil = l_hasil + CHR(ASC(SUBSTR(p_kata, i, 1)) + ASC(SUBSTR(l_acak, l_index, 1)))
  • l_index = l_index + 1
  • IF l_index > LEN(l_acak)
  • l_index = 1
  • ENDIF
  • ENDFOR
  • RETURN l_hasil
  • ENDFUNC
This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s