Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@nxtedition/newfor-client

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nxtedition/newfor-client

NEWFOR client library

latest
npmnpm
Version
1.0.2
Version published
Maintainers
0
Created
Source

Node client library for the NEWFOR protocol

NXT issue: https://github.com/nxtedition/nxt/issues/10175

Usage

  • Create an instance of the NewforEncoder

    import NewforEncoder from './newfor-encoder.js'
    const newfor = new NewforEncoder(stream)  // stream is a writable stream
    
  • "Initiera live mode"

    newfor.setSubtitlePage(page)    // page is the wanted page, 399 in the captures
    newfor.setSubtitlePage(0)       // don't know why or if this is needed
    
  • Set and display subtitles

    newfor.setBuffer(["row 1", "row 2"])    // Captures have examples of 1 or 2 rows. Word wrapping should be done before passing the rows to the encoder. Rows should not be longer that 35 characters
    newfor.display()                        // This is the command that actually displays the set buffer
    
  • Hide subtitles

    newfor.hide()       // hides the subtitles
    
  • Shutdown

    newfor.hide() 
    newfor.setSubtitlePage(999)     // this indicates that subtitling is to be terminated
    

Resources

Messages

Type 2 (Set Subtitle Buffer)

Spec Says:

  • 0x8F, 8 x Clearbit + No. of subtitle rows
  • Hamming encoded
  • Each row of subtitle information consists of:
  • top 4 bits of row No, bottom Top 4 bits of row No, 40 data bytes
  • Hamming Encoded (Binary)

Recording have

  • 0x8F 0x47 <- apparently "8x clearbit + No. of subtitle rows"
  • 0x02 0x38 (Hamming encoded) -> 0x01, 0x06 = 0x16 = 22 (resonable row no.)
  • Following is 40 bytes of data:
    • 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 (11 spaces.)
    • 0x0d 0x07 0x0b 0x0b (4 control characters. "double height", "Alpha white alphabetic, white foreground", "start box", "start box")
    • 0x54 0xf4 0xf4 0x20 0xf4 0xe5 0x73 0xf4 0xae ("Ttt test." Using sk 'odd parity')
    • 0x8a 0x8a ("end box", "end box". Using odd parity)
    • 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 0x20 (14 spaces.)

FAQs

Package last updated on 10 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts