lib/ogn_client/aprs.rb
# Calculate the passcode from the callsign
Calculate the passcode from the callsign
Calculate the passcode from the callsign
def passcode(readonly: true)
      if readonly
        -1
      else
      	@callsign.split('-').first.chars.reduce([0x73E2, true]) do |hash, char|
          [hash.first ^ (hash.last ? char.ord << 8 : char.ord), !hash.last]
      	end.first & 0x7FFF
      end
    end
def passcode ( readonly : true ) if readonly - 1 else @callsign . split ( '-' ) . first . chars . reduce ( [ 0x73E2 , true ] ) do | hash , char | [ hash . first ^ ( hash . last ? char . ord << 8 : char . ord ) , ! hash . last ] end . first & 0x7FFF end end
Calculate the passcode from the callsign
Calculate the passcode from the callsign
readonly
<not_specific>